<?php
/**
 * Created by PhpStorm.
 * User: hishenng
 * Date: 2017/6/8
 * Time: 14:29
 */
namespace App\Http\Controllers\Api;


use App\Banner;
use App\Dao\ApplyDao;
use App\Dao\BannerDao;
use App\Dao\LoanDao;
use App\Http\Controllers\Controller ;
use Illuminate\Support\Facades\Input;

class BannerController extends Controller{
    public $banner;
    public $bannerDao;
    public $applyDao;
    public $loanDao;
    public function __construct(Banner $banner ,BannerDao $bannerDao ,ApplyDao $applyDao ,LoanDao $loanDao)
    {
        $this->banner = $banner ;
        $this->bannerDao = $bannerDao;
        $this->applyDao = $applyDao;
        $this->loanDao = $loanDao;
    }
    
    public function index(){
        $data = [];
        $data['banners'] = $this->bannerDao->all();
        $data['apply'] = $this->applyDao->last();
        $data['sum'] = $this->loanDao->sum();
       
        return $this->json($data);
    }
    
}